<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    /*
    显示转换
      编写程序时过度依赖系统内部的隐式转换是不规范的，因为隐式转换规律不清晰，通常根据逻辑需要对数据进行显示转换
    */
    // 转number类型
    let str = "123"
    console.log(Number(str))
    console.log(parseFloat(str))
    console.log(parseInt(str))
    console.log(str - 0)

    // 转boolean类型
    let str1 = "5"
    let empty = ""
    let num = 0
    console.log(Boolean(str))
    console.log(Boolean(str1))
    console.log(Boolean(empty))
    console.log(Boolean(num))

    // 转string类型
    let num6=54
    console.log(num6.toString())
    console.log(num6+'')
</script>
</body>
</html>